import request from '@/utils/request'

export function addDormBuilding(data) {
  return request({
    url: '/dormBuilding/add',
    method: 'post',
    data
  })
}

export function updateDormBuilding(data) {
  return request({
    url: '/dormBuilding/update',
    method: 'put',
    data
  })
}

export function deleteDormBuilding(id) {
  return request({
    url: `/dormBuilding/delete/${id}`,
    method: 'delete'
  })
}

export function batchDeleteDormBuilding(ids) {
  return request({
    url: '/dormBuilding/batchDelete',
    method: 'post',
    data: ids
  })
}

export function getDormBuildingPage(params) {
  return request({
    url: '/dormBuilding',
    method: 'get',
    params
  })
}

export function getDormBuildingById(id) {
  return request({
    url: `/dormBuilding/queryById/${id}`,
    method: 'get'
  })
}

export function getDormBuildingByNo(buildingNo) {
  return request({
    url: '/dormBuilding/queryByNo',
    method: 'get',
    params: { buildingNo }
  })
}